package com.xumx.demo.pojo;

import lombok.Data;

/**
 * 异常统一返回的类
 */

@Data
public class ResponseObject<T> {

    private Integer code;
    private String message;
    private T data;

    public ResponseObject(Integer code, String message, T data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    /**
     * 请求成功
     */
    public static <T> ResponseObject<T> success(T data) {
        return new ResponseObject<T>(200, "success", data);
    }


}
